Conversation
5b44d27 to
94ffff2
Compare
| }) | ||
| }) | ||
|
|
||
| describe('jss-nested', () => { |
There was a problem hiding this comment.
this test actually belongs to jss-nested
There was a problem hiding this comment.
alternatively we could describe the same scenario using plugins api instead of jss-nested plugin
There was a problem hiding this comment.
I think that this test should be here because it tests the way how rules apply in some cases, so the same scenario instead of jss-nested looks better for me
| }) | ||
|
|
||
| it('should save the added nested rules order', () => { | ||
| expect(getCssFromSheet(sheet)).to.be(removeWhitespace(sheet.toString())) |
There was a problem hiding this comment.
we only use DOM based tests in functional tests, is DOM really needed here or sheet.toString() + comparing with result would be enough?
There was a problem hiding this comment.
yeah, I think we can replace expect with the exact result
| // Don't insert rule directly if there is no stringified version yet. | ||
| // It will be inserted all together when .attach is called. | ||
| if (queue) queue.push(rule) | ||
| if (queue) queue.unshift(rule) |
There was a problem hiding this comment.
I am not sure why this is not breaking anything else. You are reverting the order of added rules for all addRule calls. Maybe there is a missing test which ensures the right order.
We have actually an options.index which is set in jss-nested in order to have the control over the order. Maybe jss-nested sets the wrong index?
|
totally forgot this one |
|
@lttb whats the state here? |
Fix an issue from cssinjs/styled-jss#59
The problem is when we add rules by
.addRules, it has some issues with nested rules order.